package easycloud.ecs.web.service;

import javax.inject.Inject;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import easycloud.ecs.common.domain.Provider;
import easycloud.ecs.common.repository.ProviderRepository;

@Service
@Transactional(readOnly = true)
public class ProviderService {

	private static final Log logger = LogFactory.getLog(ProviderService.class);
	
	@Inject
	private ProviderRepository providerRepository;
	
	public Provider getProvider(Integer providerId) {
		return providerRepository.findOne(providerId);
	}
	
	@Transactional(readOnly = false)
	public void save(Provider provider) {
		providerRepository.save(provider);
	}

	@Transactional(readOnly = false)
	public void delete(Provider provider) {
		providerRepository.delete(provider);
	}

}
